import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Test {
    /**
     *游游的有
     * https://www.nowcoder.com/questionTerminal/cd117803b3364b218a8b3dcc498dee25
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int q = in.nextInt();

        while(q-- != 0){

            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();

            int x = Math.min(c,Math.min(a,b));
            System.out.println(x * 2 + Math.max(b - x - 1,0));
        }
    }

    /**
     * 约瑟夫环
     * https://www.nowcoder.com/practice/f78a359491e64a50bce2d89cff857eb6?tpId=13&tqId=11199&ru=/exam/oj
     */

}
/**
 *腐烂的苹果
 * https://www.nowcoder.com/practice/54ab9865ce7a45968b126d6968a77f34?tpId=196&tqId=40529&ru=/exam/oj
 */
class Solution {

    public int rotApple (ArrayList<ArrayList<Integer>> grid) {

        int[] dx = {0,0,1,-1};
        int[] dy = {1,-1,0,0};

        Queue<int[]> q = new LinkedList<>();
        int n = grid.size();
        int m = grid.get(0).size();
        boolean[][] vis = new boolean[n][m];
        for(int i = 0;i < n;i++){
            for(int j = 0;j < m;j++){
                if(grid.get(i).get(j) == 2){
                    q.add(new int[]{i,j});
                }
            }
        }

        int ret =0;
        while(!q.isEmpty()){

            int size = q.size();

            while(size-- != 0){
                int[] tem = q.poll();
                int a = tem[0];
                int b = tem[1];
                for(int i = 0;i < 4;i++){
                    int x = dx[i] + a;
                    int y = dy[i] + b;
                    if(x >= 0 && x < n && y >= 0 && y < m && !vis[x][y] && grid.get(x).get(y) == 1){
                        vis[x][y] = true;
                        q.add(new int[]{x,y});
                    }
                }
            }
            ret++;
        }

        for(int i = 0;i < n;i++){
            for(int j = 0;j< m ;j++){
                if(grid.get(i).get(j) == 1 && !vis[i][j])
                    return -1;
            }
        }
        return ret - 1;
    }
}
